#pragma once

#define ANAL_PAGE_X			2100
#define ANAL_PAGE_Y			2500
#define ANAL_GRID_COUNT_X	6
#define ANAL_GRID_COUNT_Y	7
#define ANAL_GRID_UNIT_X	300
#define ANAL_GRID_UNIT_Y	80
#define ANAL_SPACE_LEFT		100
#define ANAL_SPACE_TOP		400
// CAnalCtrl




class CAnalCtrl : public CWnd
{
	DECLARE_DYNAMIC(CAnalCtrl)
public:
	CFont		m_ftAnal;
	int m_nHScrollRange;
	int m_nVScrollRange;
	int m_nHScrollPos;
	int m_nVScrollPos;
	int m_nHScrollIncr;
	int m_nVScrollIncr;

	int m_arrGridUnitX[7];
	CBrush* m_pBrushWhite;
//	CFmContext* m_pContext;
	CMenu m_PopMenu;

	BOOL	Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); 
	void	OnDrawAnalTable(CDC* pDC, CFm* pFm, int nLeft, int nTop);
	void	OnDrawAnalParams(CDC* pDC, CFm* pFm, int nLeft, int nTop, int nRight, int nBottom);
	void	OnDraw(CDC* pDC, int nLeft, int nTop, int nRight, int nBottom);
	BOOL	BuildAnalResult();
	void    ClearAnalResult();


public:
	CAnalCtrl();
	virtual ~CAnalCtrl();
	virtual BOOL DestroyWindow();
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	DECLARE_MESSAGE_MAP()
};


